package io;

import java.io.*;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "爱坤";
        int age = 22;
        String gender = "男";
        String[] otherinfo = {"唱歌","跳舞","rap","打篮球"};

        Person p = new Person(name,age,gender,otherinfo);
        System.out.println(p);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(p);
        System.out.println("写出完毕");

        oos.close();

    }
}
